import request from "@/utils/request"
import type { Version } from "./type"

export const uploadVersion = (file: File, version: Version) => {
    return request.post("/system/version/upload", {
        "file": file,
        "name": version.name,
        "content": version.content
    },
    {
        headers: {
            "Content-Type": "multipart/form-data"
        },
        timeout: 60000
    })
}

export const getVersionList = () => {
    return request.get("/system/version/list")
}